#!/bin/bash

cd "$1" # 学期课程目录

export set_score_fields="${SCORE_FIELDS:=1,2,10}"

find ./01.学生试卷/ -maxdepth 1 -mindepth 1 -printf "%f\n" |xargs -I{} grep {} exam_paper_scores.txt |sort -r -n -k 12 |cut -f "${set_score_fields}" | awk -f ../../organize_exam_papers.awk - |cut -d: -f 2